<?php $this->widget('zii.widgets.CPortlet', array('title'=>'',	));?>
<?php $this->widget('ext.paginate.pagination.paginationWidget');?>

<script type="text/javascript">
<!--

	/**
	* Initialisation function for pagination
	*/
	function initPagination() {
		// count entries inside the hidden content
		//var num_entries = jQuery('#hiddenresult div.result').length;
		var num_entries = <?php echo $pageInfo['itemsCount']?$pageInfo['itemsCount']:0;?>;
		// Create content inside pagination element
		
		jQuery("#Pagination").pagination(num_entries, {
			callback: pageselectCallback,
			items_per_page:<?php echo $pageInfo['offset'];?> // Show only one item per page
		});
	}

	function ajaxLoad(){
	    var h = (jQuery(window).height()-jQuery("#loading").height())/3;
		var w = (jQuery(window).width()-jQuery("#loading").width())/2;
	
		
		jQuery("#loading").css({"top":h+'px',"left":w+'px'}).hide().ajaxStart(function(){			
			jQuery(this).fadeIn();
		}).ajaxStop(function(){
			jQuery(this).fadeOut();			
		});
	}

	jQuery.noConflict();
	// When document is ready, initialize pagination
	jQuery(document).ready(function(){
		initPagination();
		ajaxLoad();

		$("#item-update").button();
	}); 
//-->
</script>
<div class="form">
	<div style="height:550px;">
		<div style="margin-bottom:15px;" class="row">
			<input type="checkbox" id="checkAll" onchange="checkAll($(this));" />&nbsp;&nbsp;
			<select id="select" style="width:150px;">
				<option>批量操作</option>
				<option value="1">删除</option>
			</select>&nbsp;&nbsp;		
			<button id="item-update" onclick="deleteItems();">更新</button>
		</div>	
		<div id="category-list" class="box-content">
		
		</div>	
		<div id="Pagination" class="left" style="margin-top:20px; width:90%;"></div>
		<div class="note left">
			<ol>备注：此处有一点小问题
				<li>当增加分类时虽可是看到增加的树状图，但页码却没有改变！</li>
				<li>当更新完毕，重新加载时不能加载当前页</li>		
		</div>
	</div>

</div>
<div id="hideResult" style="display:none;">
	<div class="results"></div>
</div>